Skip to content

disable DTDs and external entities in KMIPInputStream - #2315

Closed
digi-scrypt wants to merge 1 commit into
bcgit:mainfrom
digi-scrypt:kmip-xxe-disable-dtd
Closed

disable DTDs and external entities in KMIPInputStream#2315
digi-scrypt wants to merge 1 commit into
bcgit:mainfrom
digi-scrypt:kmip-xxe-disable-dtd

Conversation

@digi-scrypt

Copy link
Copy Markdown
  1. KMIPInputStream builds its XMLEventReader from a bare XMLInputFactory, so a DOCTYPE in a parsed KMIP message is honoured and external SYSTEM entities get resolved as parse() pulls events.
  2. a file:// or http:// entity then turns into a local file read or an outbound request from whichever side parses the message; aiming one at a missing path drops a "No such file or directory" straight out of the parse loop, which is the tell.
    Set SUPPORT_DTD=false (and external entities off as a backstop) on the factory before creating the reader. Messages without a doctype parse exactly as before.

@dghgit

dghgit commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Thanks for the patch. Merged!

@dghgit dghgit closed this Jul 7, 2026
hubot pushed a commit that referenced this pull request Jul 7, 2026
… KMIPInputStream XXE (DTD/external-entity) hardening, relates to github #2315.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants